package com.adcc.loadSheetForwarder.entity;

import com.adcc.loadSheetForwarder.vo.FlightVO;
import com.google.common.base.Strings;
import lombok.Data;

/**
 * 航班实体
 */
@Data
public class Flight {
    /**
     * 航班号
     */
    private String flightNo;

    /**
     * 航班日期
     */
    private String flightDate;

    /**
     * 起飞机场三字码
     */
    private String deptAirport;

    /**
     * 降落机场三字码
     */
    private String arrAirport;

    /**
     * 机尾号
     */
    private String aircraftNo;

    /**
     * 舱单版本
     */
    private String version;

    /**
     * 代理代码
     */
    private String agent;

    public FlightVO toVO() {
        FlightVO vo = new FlightVO();
        vo.setFlightNo(this.flightNo);
        vo.setFlightDate(this.flightDate);
        vo.setDeptAirport(this.deptAirport);
        vo.setArrAirport(this.arrAirport);
        vo.setAircraftNo(this.aircraftNo);
        vo.setVersion(this.version);
        vo.setAgent(Strings.nullToEmpty(this.agent));
        return vo;
    }
}
